<!-- $Id: user_info.htm 16854 2009-12-07 06:20:09Z sxc_shop $ -->
{include file="pageheader.htm"}
<div class="main-div">
<form method="post" action="users.php" name="theForm" onsubmit="return validate()">
<table width="100%" >
  <tr>
    <td class="label">User Name:</td>
    <td><input type="text" name="user_name" maxlength="60" value="{$user.user_name}" /></td>
  </tr>
  <tr>
    <td class="label">Email:</td>
    <td><input type="text" name="email" maxlength="60" size="40" value="{$user.email}" />{$lang.require_field}</td>
  </tr>
  <tr>
    <td class="label" name="user_type">User Type:</td>
	<td><select id="user_type" name="user_type">
			{foreach from=$user_type item=type}
			<option value="{$type.mid}">{$type.name}</option>
			{/foreach}
			</select>
			<script>
				document.getElementById("user_type").value="{$user.user_type}";
			</script>
            </td>
  </tr>
  <tr>
    <td class="label">Gender:</td>
    <td><select id="gender_type" name="gender_type">
			{foreach from=$gender_type item=type}
			<option value="{$type.xid}">{$type.genderType}</option>
			{/foreach}
			</select>
			<script>
				document.getElementById("gender_type").value="{$user.sex}";
			</script>
            </td>
  </tr>
  <tr>
    <td class="label">Register Date:</td>
    <td>{html_select_date field_order="YMD" prefix="birthday" time=$user.reg_time start_year="-60" end_year="+1" display_days=true month_format="%m"}</td> 
  </tr>
  <tr>
    <td class="label">Last Login Date:</td>
    <td>{html_select_date field_order="YMD" prefix="birthday" time=$user.last_login start_year="-60" end_year="+1" display_days=true month_format="%m"}</td>
  </tr>
  <tr>
    <td class="label">Last IP:</td>
    <td><input type="text" name="last_ip" maxlength="60" value="{$user.last_ip}" /></td>
  </tr>
  <tr>
    <td class="label">Visit Count:</td>
    <td><input type="text" name="visit_count" maxlength="60" value="{$user.visit_count}" /></td>
  </tr>
  <tr>
    <td class="label">First Name:</td>
    <td><input type="text" name="first_name" maxlength="60" value="{$user.firstname}" /></td>
  </tr>
  <tr>
    <td class="label">Last Name:</td>
    <td><input type="text" name="last_name" maxlength="60" value="{$user.lastname}" /></td>
  </tr>
  <tr>
    <td class="label">Province:</td>
    <td><input type="text" name="province" maxlength="60" value="{$user.province}" /></td>
  </tr>
  <tr>
    <td class="label">City:</td>
    <td><input type="text" name="city" maxlength="60" value="{$user.address}" /></td>
  </tr>
  <tr>
    <td class="label">Country:</td>
    <td><input type="text" name="country" maxlength="60" value="{$user.country}" /></td>
  </tr>
  <tr>
    <td class="label">Zip Code:</td>
    <td><input type="text" name="zip_code" maxlength="60" value="{$user.zipcode}" /></td>
  </tr>
  <!--{if $user.user_type eq 2}-->
  <!--<tr>
    <td class="label">Projects Created:</td>
    <td><input type="text" name="projects_created" maxlength="60" value="{$user.projectsCreated}" /></td>
  </tr>
  <tr>
    <td class="label">Projects Awarded:</td>
    <td><input type="text" name="projects_awarded" maxlength="60" value="{$user.projectsAwarded}" /></td>
  </tr>
  <tr>
    <td class="label">Phone:</td>
    <td><input type="text" name="phone" maxlength="60" value="{$user.phone}" /></td>
  </tr> -->
  <!--{else}-->
  <!--<tr>
    <td class="label">Experience:</td>
    <td><input type="text" name="experience" maxlength="60" value="{$user.experience}" /></td>
  </tr>
  <tr>
    <td class="label">Training Service:</td>
    <td><input type="text" name="training_service" maxlength="60" value="{$user.trainingService}" /></td>
  </tr>
  <tr>
    <td class="label">Training Specialties:</td>
    <td><input type="text" name="training_specialties" maxlength="60" value="{$user.trainingSpecialties}" /></td>
  </tr>
  <tr>
    <td class="label">Credentials:</td>
    <td><input type="text" name="credentials" maxlength="60" value="{$user.credentials}" /></td>
  </tr>
  <tr>
    <td class="label">Education Level:</td>
    <td><input type="text" name="education_level" maxlength="60" value="{$user.eduLevel}" /></td>
  </tr>
  <tr>
    <td class="label">School:</td>
    <td><input type="text" name="school" maxlength="60" value="{$user.school}" /></td>
  </tr>
  <tr>
    <td class="label">Major:</td>
    <td><input type="text" name="major" maxlength="60" value="{$user.major}" /></td>
  </tr>
  <tr>
    <td class="label">BIO:</td>
    <td><input type="text" name="BIO" maxlength="60" value="{$user.BIO}" /></td>
  </tr> -->
  <!--{/if}-->
  <tr>
    <td colspan="2" align="center">
      <input type="submit" value="Save Change" class="button" />
      <input type="hidden" name="act" value="member_modify" />
      <input type="hidden" name="user_id" value="{$user.user_id}" />    
	</td>
  </tr>
</table>

</form>
</div>
{insert_scripts files="../js/utils.js,validator.js"}
{literal}
<script language="JavaScript">
<!--

if (document.forms['theForm'].elements['act'].value == "insert")
{
  document.forms['theForm'].elements['username'].focus();
}
else
{
  document.forms['theForm'].elements['email'].focus();
}

onload = function()
{
    // 开始检查订单
    startCheckOrder();
}

/**
 * 检查表单输入的数据
 */
function validate()
{
    validator = new Validator("theForm");
    validator.isEmail("email", invalid_email, true);

    if (document.forms['theForm'].elements['act'].value == "insert")
    {
        validator.required("username",  no_username);
        validator.required("password", no_password);
        validator.required("confirm_password", no_confirm_password);
        validator.eqaul("password", "confirm_password", password_not_same);

        var password_value = document.forms['theForm'].elements['password'].value;
        if (password_value.length < 6)
        {
          validator.addErrorMsg(less_password);
        }
        if (/ /.test(password_value) == true)
        {
          validator.addErrorMsg(passwd_balnk);
        }
    }
    else if (document.forms['theForm'].elements['act'].value == "update")
    {
        var newpass = document.forms['theForm'].elements['password'];
        var confirm_password = document.forms['theForm'].elements['confirm_password'];
        if(newpass.value.length > 0 || confirm_password.value.length)
        {
          if(newpass.value.length >= 6 || confirm_password.value.length >= 6)
          {
            validator.eqaul("password", "confirm_password", password_not_same);
          }
          else
          {
            validator.addErrorMsg(password_len_err);
          }
        }
    }

    return validator.passed();
}
//-->
</script>
{/literal}
{include file="pagefooter.htm"}
